package Tricky;

import java.util.Scanner;

class Solver1876
{	int a,b,rs;

	public void Input()
	{	Scanner in=new Scanner(System.in);
		a=in.nextInt();b=in.nextInt();
		in.close();
	}
	public void Solve()
	{	int m=40+1+2*39+2*(a-40),n=2*b+40;
		rs=m>n?m:n;
	}
	public void Output()
	{	System.out.println(rs);
	}
	public void main()
	{	Input();
		Solve();
		Output();
	}
}
public class P1876
{	public static void main(String[] args)
	{	Solver1876 solver=new Solver1876();
		solver.main();
	}
}
